﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UPMS.Core.Domain.Mapping
{
    public class HostMap : BaseMap<Host>
    {
        public HostMap()
        {
            this.ToTable("Upms_tbl_Host");
            this.Property(h => h.Name).HasColumnName("Name").HasMaxLength(64).IsRequired();         
            this.Property(h => h.IP).HasColumnName("IP"); 

            this.HasMany(h => h.Applications).WithRequired(a => a.Host).HasForeignKey(a => a.HostId);
        }
    }
}
